
export const shareMixins = {
    data() {
        return {
            shareData: {
                title: '', //分享内容的标题
                path: '', //分享内容跳转的页面
                imageUrl: '', //分享内容展示的图片
                content: '', //分享内容展示的文本内容
                desc: ''
            }
        }
    },

    //#ifdef MP-WEIXIN
    onShareAppMessage(e) { //分享到微信页面
        // console.log(e)
        // let shareInfo = this.shareData;
        // if (e.from == 'button') { //自定义按钮分享
        //     let _data = e.target.dataset;
        //     if (_data.name == 'invite') { //邀约
        //         shareInfo = _data.datum;
        //     }
        // }
        // let sharePath = shareInfo.path;
        // if (uni.getStorageSync('userInfo')) { //处理分享用户
        //     let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
        //     sharePath += '?inviteCustId=' + userInfo.custId;
        // }
        // let shareImg = shareInfo.imageUrl; //处理分享图片
        // if (shareInfo.imageUrl.indexOf('http') == -1) {
        //     shareImg = urlConfig.fixedCodeUrl + '/resources/miniHMWelfare' + shareInfo.imageUrl;
        // }
        console.log(this.shareMixins.path,666)
        return {
            // title: shareInfo.title,
            path: this.shareMixins.path,
            // imageUrl: shareImg,
            // content: shareInfo.content,
            // desc: shareInfo.desc,
            success: res => {
                console.info(res)
            }
        }
    },
    onShareTimeline(e) { //分享到微信朋友圈
        // console.log(e)
        // let shareInfo = this.shareData;
        // if (e.from == 'button') { //自定义按钮分享
        //     let _data = e.target.dataset;
        //     if (_data.name == 'invite') { //邀约
        //         shareInfo = _data.datum;
        //     }
        // }
        // let sharePath = shareInfo.path;
        // if (uni.getStorageSync('userInfo')) { //处理分享用户
        //     let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
        //     sharePath += '?inviteCustId=' + userInfo.custId;
        // }
        // let shareImg = shareInfo.imageUrl; //处理分享图片
        // if (shareInfo.imageUrl.indexOf('http') == -1) {
        //     shareImg = urlConfig.fixedCodeUrl + '/resources/miniHMWelfare' + shareInfo.imageUrl;
        // }
        // console.log(shareInfo, sharePath, shareImg)
        return {
            // title: shareInfo.title,
            path: sharePath,
            // imageUrl: shareImg,
            // content: shareInfo.content,
            // desc: shareInfo.desc,
            success: res => {
                console.info(res)
            }
        }
    },
    //#endif

    onLoad(option) {}
}